package com.ruoyi.food.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.food.object.TActOrder;
import com.ruoyi.food.object.TActivity;
import com.ruoyi.food.service.TActivityService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 活动controller
 * @author mengcc
 *
 */
@Controller
@Api(value = "TActivityController", tags = "活动controller")
@RequestMapping("/activity")
public class TActivityController extends BaseController{
	
	@Autowired
	private TActivityService tActivityService;
	
	/**
	 * 进入活动页面
	 * @return
	 */
	@GetMapping()
    public String activity()
    {
        return "page/activity";
    }
	
	/**
	 * 查询活动详情
	 * @param tActivity
	 * @return
	 */
	@PostMapping("/list")
	@ApiOperation("查询活动列表")
	@ResponseBody
    public TableDataInfo findTActivity(TActivity tActivity)
    {

		startPage();
		List<TActivity> list=new ArrayList<>();

		list=tActivityService.findAllActivity(tActivity);
        
        return getDataTable(list);
    }

}
